import { PropType } from 'vue'
import type { ExtractProps } from '@/utils/type'
import { ButtonNS } from '@/components'
import { useNamespace } from '@/utils'

export namespace variables {
  export const ns = useNamespace('Checkbox')
}
export namespace CheckboxNS {
  export const name = variables.ns.name
  export const props = {
    modelValue: Boolean,
    disabled: Boolean,
    buttonProps: Object as PropType<Omit<ButtonNS.Props, 'loading'>>
  }
  type BaseProps = ExtractProps.Types<typeof props>
  export const emits = {
    change: (_val: BaseProps['modelValue']) => true,
    'update:modelValue': (_val: BaseProps['modelValue']) => true
  }
  export type Props = BaseProps & PartialEmits<typeof emits>
  export const Component = <{
    new(): {
      $props: Props
    }
  }>{}
}